
sort_string.o:     file format elf64-littleaarch64


Disassembly of section .text:

0000000000000000 <main>:
#define HALT 	" "

void stsrt(char *string[], int num);

int main()
{
   0:	d11c03ff 	sub	sp, sp, #0x700
   4:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
   8:	910003fd 	mov	x29, sp
	char input[LIM][SIZE];
	char *ptstr[LIM];
	int ct = 0; 
   c:	b9070fbf 	str	wzr, [x29, #1804]
	int k;

	printf("Input up to %d lines, and I will sort them.\n", LIM);
  10:	90000000 	adrp	x0, 0 <main>
  14:	91000000 	add	x0, x0, #0x0
  18:	52800281 	mov	w1, #0x14                  	// #20
  1c:	94000000 	bl	0 <printf>
	printf("To stop, press the Enter key at a line's start.\n");
  20:	90000000 	adrp	x0, 0 <main>
  24:	91000000 	add	x0, x0, #0x0
  28:	94000000 	bl	0 <puts>
	while (ct < LIM && gets(input[ct]) != NULL && input[ct][0] != '\0') {
  2c:	14000010 	b	6c <main+0x6c>
		ptstr[ct] = input[ct];
  30:	9102c3a2 	add	x2, x29, #0xb0
  34:	b9870fa1 	ldrsw	x1, [x29, #1804]
  38:	aa0103e0 	mov	x0, x1
  3c:	d37ef400 	lsl	x0, x0, #2
  40:	8b010000 	add	x0, x0, x1
  44:	d37cec00 	lsl	x0, x0, #4
  48:	8b010000 	add	x0, x0, x1
  4c:	8b000042 	add	x2, x2, x0
  50:	b9870fa0 	ldrsw	x0, [x29, #1804]
  54:	d37df000 	lsl	x0, x0, #3
  58:	910043a1 	add	x1, x29, #0x10
  5c:	f8206822 	str	x2, [x1, x0]
		ct++;
  60:	b9470fa0 	ldr	w0, [x29, #1804]
  64:	11000400 	add	w0, w0, #0x1
  68:	b9070fa0 	str	w0, [x29, #1804]
	while (ct < LIM && gets(input[ct]) != NULL && input[ct][0] != '\0') {
  6c:	b9470fa0 	ldr	w0, [x29, #1804]
  70:	71004c1f 	cmp	w0, #0x13
  74:	540002ec 	b.gt	d0 <main+0xd0>
  78:	9102c3a2 	add	x2, x29, #0xb0
  7c:	b9870fa1 	ldrsw	x1, [x29, #1804]
  80:	aa0103e0 	mov	x0, x1
  84:	d37ef400 	lsl	x0, x0, #2
  88:	8b010000 	add	x0, x0, x1
  8c:	d37cec00 	lsl	x0, x0, #4
  90:	8b010000 	add	x0, x0, x1
  94:	8b000040 	add	x0, x2, x0
  98:	94000000 	bl	0 <gets>
  9c:	93407c00 	sxtw	x0, w0
  a0:	f100001f 	cmp	x0, #0x0
  a4:	54000160 	b.eq	d0 <main+0xd0>  // b.none
  a8:	b9870fa1 	ldrsw	x1, [x29, #1804]
  ac:	aa0103e0 	mov	x0, x1
  b0:	d37ef400 	lsl	x0, x0, #2
  b4:	8b010000 	add	x0, x0, x1
  b8:	d37cec00 	lsl	x0, x0, #4
  bc:	8b010000 	add	x0, x0, x1
  c0:	9102c3a1 	add	x1, x29, #0xb0
  c4:	38606820 	ldrb	w0, [x1, x0]
  c8:	7100001f 	cmp	w0, #0x0
  cc:	54fffb21 	b.ne	30 <main+0x30>  // b.any
	}

	stsrt(ptstr, ct);
  d0:	910043a0 	add	x0, x29, #0x10
  d4:	b9470fa1 	ldr	w1, [x29, #1804]
  d8:	94000000 	bl	130 <stsrt>

	puts("\nHere's the sorted list: \n");
  dc:	90000000 	adrp	x0, 0 <main>
  e0:	91000000 	add	x0, x0, #0x0
  e4:	94000000 	bl	0 <puts>
	for (k = 0; k < ct; k++)
  e8:	b9070bbf 	str	wzr, [x29, #1800]
  ec:	14000009 	b	110 <main+0x110>
		puts(ptstr[k]);
  f0:	b9870ba0 	ldrsw	x0, [x29, #1800]
  f4:	d37df000 	lsl	x0, x0, #3
  f8:	910043a1 	add	x1, x29, #0x10
  fc:	f8606820 	ldr	x0, [x1, x0]
 100:	94000000 	bl	0 <puts>
	for (k = 0; k < ct; k++)
 104:	b9470ba0 	ldr	w0, [x29, #1800]
 108:	11000400 	add	w0, w0, #0x1
 10c:	b9070ba0 	str	w0, [x29, #1800]
 110:	b9470ba1 	ldr	w1, [x29, #1800]
 114:	b9470fa0 	ldr	w0, [x29, #1804]
 118:	6b00003f 	cmp	w1, w0
 11c:	54fffeab 	b.lt	f0 <main+0xf0>  // b.tstop

	return 0;
 120:	52800000 	mov	w0, #0x0                   	// #0
}
 124:	a8c17bfd 	ldp	x29, x30, [sp], #16
 128:	911c03ff 	add	sp, sp, #0x700
 12c:	d65f03c0 	ret

0000000000000130 <stsrt>:

void stsrt(char *string[], int num)
{
 130:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
 134:	910003fd 	mov	x29, sp
 138:	f9000fa0 	str	x0, [x29, #24]
 13c:	b90017a1 	str	w1, [x29, #20]
	char *temp;
	int top, seek;

	for (top = 0; top < num - 1; top++)
 140:	b9002fbf 	str	wzr, [x29, #44]
 144:	14000034 	b	214 <stsrt+0xe4>
		for (seek = top + 1; seek < num; seek++)
 148:	b9402fa0 	ldr	w0, [x29, #44]
 14c:	11000400 	add	w0, w0, #0x1
 150:	b9002ba0 	str	w0, [x29, #40]
 154:	14000029 	b	1f8 <stsrt+0xc8>
			if (strcmp(string[top], string[seek]) > 0) {
 158:	b9802fa0 	ldrsw	x0, [x29, #44]
 15c:	d37df000 	lsl	x0, x0, #3
 160:	f9400fa1 	ldr	x1, [x29, #24]
 164:	8b000020 	add	x0, x1, x0
 168:	f9400002 	ldr	x2, [x0]
 16c:	b9802ba0 	ldrsw	x0, [x29, #40]
 170:	d37df000 	lsl	x0, x0, #3
 174:	f9400fa1 	ldr	x1, [x29, #24]
 178:	8b000020 	add	x0, x1, x0
 17c:	f9400000 	ldr	x0, [x0]
 180:	aa0003e1 	mov	x1, x0
 184:	aa0203e0 	mov	x0, x2
 188:	94000000 	bl	0 <strcmp>
 18c:	7100001f 	cmp	w0, #0x0
 190:	540002ed 	b.le	1ec <stsrt+0xbc>
				temp = string[top];
 194:	b9802fa0 	ldrsw	x0, [x29, #44]
 198:	d37df000 	lsl	x0, x0, #3
 19c:	f9400fa1 	ldr	x1, [x29, #24]
 1a0:	8b000020 	add	x0, x1, x0
 1a4:	f9400000 	ldr	x0, [x0]
 1a8:	f90013a0 	str	x0, [x29, #32]
				string[top] = string[seek];
 1ac:	b9802fa0 	ldrsw	x0, [x29, #44]
 1b0:	d37df000 	lsl	x0, x0, #3
 1b4:	f9400fa1 	ldr	x1, [x29, #24]
 1b8:	8b000020 	add	x0, x1, x0
 1bc:	b9802ba1 	ldrsw	x1, [x29, #40]
 1c0:	d37df021 	lsl	x1, x1, #3
 1c4:	f9400fa2 	ldr	x2, [x29, #24]
 1c8:	8b010041 	add	x1, x2, x1
 1cc:	f9400021 	ldr	x1, [x1]
 1d0:	f9000001 	str	x1, [x0]
				string[seek] = temp;
 1d4:	b9802ba0 	ldrsw	x0, [x29, #40]
 1d8:	d37df000 	lsl	x0, x0, #3
 1dc:	f9400fa1 	ldr	x1, [x29, #24]
 1e0:	8b000020 	add	x0, x1, x0
 1e4:	f94013a1 	ldr	x1, [x29, #32]
 1e8:	f9000001 	str	x1, [x0]
		for (seek = top + 1; seek < num; seek++)
 1ec:	b9402ba0 	ldr	w0, [x29, #40]
 1f0:	11000400 	add	w0, w0, #0x1
 1f4:	b9002ba0 	str	w0, [x29, #40]
 1f8:	b9402ba1 	ldr	w1, [x29, #40]
 1fc:	b94017a0 	ldr	w0, [x29, #20]
 200:	6b00003f 	cmp	w1, w0
 204:	54fffaab 	b.lt	158 <stsrt+0x28>  // b.tstop
	for (top = 0; top < num - 1; top++)
 208:	b9402fa0 	ldr	w0, [x29, #44]
 20c:	11000400 	add	w0, w0, #0x1
 210:	b9002fa0 	str	w0, [x29, #44]
 214:	b94017a0 	ldr	w0, [x29, #20]
 218:	51000401 	sub	w1, w0, #0x1
 21c:	b9402fa0 	ldr	w0, [x29, #44]
 220:	6b00003f 	cmp	w1, w0
 224:	54fff92c 	b.gt	148 <stsrt+0x18>
			}
}
 228:	d503201f 	nop
 22c:	a8c37bfd 	ldp	x29, x30, [sp], #48
 230:	d65f03c0 	ret
